package com.pai4j.remote.oss;

import com.pai4j.common.bean.PAIResponseBean;
import com.pai4j.domain.vo.response.UploadResultVO;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 *  文件远程调用接口
 *
 * @author: CYM-pai
 * @date: 2025/04/24 16:43
 **/

@FeignClient(name = "pai4j-oss-service", contextId = "fileServiceClient")
public interface FileServiceClient {
    
    @PostMapping("/oss-service/oss/upload")
    PAIResponseBean<UploadResultVO> upload(MultipartFile file);
    
    @PostMapping("/oss-service/oss/upload/editor")
    PAIResponseBean<UploadResultVO> uploadEditor(@RequestParam("file") MultipartFile file);
    
    
    @GetMapping("/oss-service/oss/download")
    void download(@RequestParam String filename, HttpServletResponse response);
    
    
    
}
